class KaL_LottoModel {
  var id;
  var lotteryid;
  var regularnumbersdrawn;
  var regularnumbermin;
  var regularnumbermax;
  var bonusnumbersdrawn;
  var extranumbersdrawn;
  var extranumbermin;
  var extranumbermax;
  var active;
  var playable;
  int? nextDrawTimeStamp;
  var timeDiffToNextDraw;

  String? lotteryname;
  String? slug;
  String? continent;
  String? country;
  String? currency;
  String? drawtime;
  String? timezone;
  String? bonusnumbername;
  String? extranumbername;
  String? priceperline_btc;
  String? priceperline_eth;
  String? priceperline_eur;
  String? officialwebsiteurl;
  String? nextjackpot;
  String? color;
  String? nextDrawDateTime;

  ///results
  String? localdrawtime;
  String? jackpot;
  String? verified;
  List? regularnumbers;
  List? extranumbers;
  List? payouttable;

  late List? bonusnumbers;
  late var ml_drawid;
  late var detailpagetitle;
  late var detailpagekeyword;
  late var detailpagedesc;

  KaL_LottoModel({
    this.id,
    this.lotteryid,
    this.regularnumbersdrawn,
    this.regularnumbermin,
    this.regularnumbermax,
    this.bonusnumbersdrawn,
    this.extranumbersdrawn,
    this.extranumbermin,
    this.extranumbermax,
    this.active,
    this.playable,
    this.nextDrawTimeStamp,
    this.timeDiffToNextDraw,
    this.lotteryname,
    this.slug,
    this.continent,
    this.country,
    this.currency,
    this.drawtime,
    this.timezone,
    this.bonusnumbername,
    this.extranumbername,
    this.priceperline_btc,
    this.priceperline_eth,
    this.priceperline_eur,
    this.officialwebsiteurl,
    this.nextjackpot,
    this.color,
    this.nextDrawDateTime,
    this.localdrawtime,
    this.jackpot,
    this.verified,
    this.regularnumbers,
    this.extranumbers,
    this.payouttable,
    this.detailpagedesc,
    this.detailpagekeyword,
    this.detailpagetitle,
    this.bonusnumbers,
    this.ml_drawid,
  });

  KaL_LottoModel.fromJson(Map<dynamic, dynamic> data) {
    id = data['id'];
    lotteryid = data['lotteryid'];
    regularnumbersdrawn = data['regularnumbersdrawn'];
    regularnumbermin = data['regularnumbermin'];
    regularnumbermax = data['regularnumbermax'];
    bonusnumbersdrawn = data['bonusnumbersdrawn'];
    extranumbersdrawn = data['extranumbersdrawn'];
    extranumbermin = data['extranumbermin'];
    extranumbermax = data['extranumbermax'];
    active = data['active'];
    playable = data['playable'];
    timeDiffToNextDraw = data['timeDiffToNextDraw'];
    nextDrawTimeStamp = data['nextDrawTimeStamp'];

    lotteryname = data['lotteryname'] ?? '';
    slug = data['slug'] ?? '';
    continent = data['continent'] ?? '';
    country = data['country'] ?? '';
    currency = data['currency'] ?? '';
    drawtime = data['drawtime'] ?? '';
    timezone = data['timezone'] ?? '';
    bonusnumbername = data['bonusnumbername'] ?? '';
    extranumbername = data['extranumbername'] ?? '';
    priceperline_btc = data['priceperline_btc'] ?? '';
    priceperline_eth = data['priceperline_eth'] ?? '';
    priceperline_eur = data['priceperline_eur'] ?? '';
    officialwebsiteurl = data['officialwebsiteurl'] ?? '';
    nextjackpot = data['nextjackpot'] ?? '';
    color = data['color'] ?? '';
    nextDrawDateTime = data['nextDrawDateTime'] ?? '';
    localdrawtime = data['localdrawtime'] ?? '';
    jackpot = data['jackpot'] ?? '';
    verified = data['verified'] ?? '';

    regularnumbers = data['regularnumbers'] ?? [];
    extranumbers = data['extranumbers'] ?? [];

    ///
    var payouts = [];
    for (var element in data['payouttable'] ?? []) {
      payouts.add(PayoutModel.fromJson(element));
    }
    payouttable = payouts;

    detailpagedesc = data['detailpagedesc'];
    detailpagekeyword = data['detailpagekeyword'];
    detailpagetitle = data['detailpagetitle'];
    bonusnumbers = data['bonusnumbers'] ?? [];
    ml_drawid = data['ml_drawid'];
  }
}

class PayoutModel {
  var sortorder;
  var winners;
  var matched;
  var payout;
  var probability;

  PayoutModel(
      {this.sortorder,
      this.winners,
      this.matched,
      this.payout,
      this.probability});

  PayoutModel.fromJson(Map<dynamic, dynamic> data) {
    sortorder = data['sortorder'];
    winners = data['winners'] ?? false;
    matched = data['matched'];
    payout = data['payout'];
    probability = data['probability'];
  }
}
